// 导入修改 昵称 的组件
import { useState } from 'react'
import { InputPopup, selPopup } from './index'
export function useEditName() {
  // 控制修改昵称简介弹层显隐的
  const [inputShow, setInputShow] = useState<InputPopup>({
    type: '',
    value: '',
    visible: false,
  })
  // 打开弹层
  const openPopup = (type: InputPopup['type'], val: string) => {
    setInputShow({
      type,
      value: val,
      visible: true,
    })
  }
  // 关闭弹层
  const closePopup = () => {
    setInputShow({
      type: '',
      value: '',
      visible: false,
    })
  }
  return { inputShow, openPopup, closePopup }
}
export function useEditSel() {

  const [selShow, setSelShow] = useState<selPopup>({
    type: '',
    visible: false,
  })
  // 打开弹层
  const openSelPopup = (type: selPopup['type']) => {
    setSelShow({
      type,
      visible: true,
    })
  }
  const closeSelPopup = () => {
    setSelShow({
      type: '',
      visible: false,
    })
  }
  return { selShow, openSelPopup, closeSelPopup }
}
